Update impl Display, omit to_string, change wording
authorManuel Stühn <freebsd@justmail.de>
Tue, 23 Nov 2021 13:38:06 +0000 (14:38 +0100)
committerColin Walters <walters@verbum.org>
Fri, 6 May 2022 16:53:57 +0000 (12:53 -0400)
rust-bindings/rust/src/object_details.rs

index 12a580cb532e9060213fca8eb1b6b4923598d060..fcf13d615dce4f65cb26622cda60924478264b3c 100644 (file)
@@ -31,18 +31,13 @@ impl ObjectDetails {
     pub fn appearances(&self) -> &Vec<String> {
         &self.object_appearances
     }
-
-    /// Format this `ObjectDetails` as a string.
-    fn to_string(&self) -> String {
-        format!("Object is {} loose and appears in {} checksums",
-                if self.loose {"available"} else {"not available"},
-                self.object_appearances.len() )
-    }
 }
 
 impl Display for ObjectDetails{
     fn fmt(&self, f: &mut Formatter) -> Result<(), Error> {
-        write!(f, "{}", self.to_string())
+        write!(f, "Object is {} and appears in {} checksums",
+                if self.loose {"loose"} else {"not loose"},
+                self.object_appearances.len() )
     }
 }